import { http } from '/@/utils/http';
import type {
  ArticleColumnListResultModel,
  AdvertsGetResultModel,
  BannersGetResultModel,
  ArticleListResultModel,
  ArticleListParams,
  ArticlePageParams,
  ArticleTagListResultModel,
  FollowListResultModel,
  ArticleResultModel,
} from './model/recommendModel';

// 文章栏目
export function queryArticleColumnList() {
  return http.post<ArticleColumnListResultModel>({
    url: '/api/app/article/column/list',
  });
}

export function queryAdverts() {
  return http.post<AdvertsGetResultModel>({
    url: '/basic-api/recommend/query_adverts',
  });
}
export function queryBanners() {
  return http.post<BannersGetResultModel>({
    url: '/basic-api/recommend/query_banners',
  });
}

// 文章列表
export function queryArticleList(params: ArticleListParams) {
  return http.post<ArticleListResultModel>({
    url: '/api/app/article/article/page',
    params,
  });
}

export function queryArticlePage(params: ArticlePageParams) {
  return http.post<ArticleListResultModel>({
    url: '/api/app/article/article/page',
    params,
  });
}

export function queryRecommendFollowerList() {
  return http.post<ArticleListResultModel>({
    url: '/basic-api/recommend/followers',
  });
}

// 文章推荐
export function queryRecommendArticleList() {
  return http.post<ArticleResultModel>({
    url: '/api/app/article/article/recommendArticle',
  });
}

// 推荐关注
export function queryRecommendFollow(id: number | null | undefined) {
  return http.post<FollowListResultModel>({
    url: '/api/app/user/user/recommendUser',
    params: {
      id,
    },
  });
}

// 标签
export function queryArticleTagList() {
  return http.post<ArticleTagListResultModel>({
    url: '/api/app/article/tag/list',
  });
}

